package com.rockcent.mall.lib.repository;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.ArticleCategory;
import com.rockcent.mall.lib.domain.Customer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by anti on 2016-08-22.
 */
@Repository
public interface CustomerRepository extends JpaRepository<Customer, Long>, JpaSpecificationExecutor,CustomerRepositoryCustom {


    Customer findByWechatOpenId(String wechatOpenId);

    Customer findByShareCode(String shareCode);

    Customer findByIdAndWechatOpenIdAndIsDelete(Long verifyPersonId, String wechatOpenId, Whether no);

    Customer findByIdAndMallId(Long customerId, Long mallId);

    Customer findByMobile(String phoneNum);

    Customer findByMobileAndMallId(String phoneNum, Long mallId);


    Customer findTop1ByWxappOpenIdAndIsDelete(String openId, Whether no);
}
